module.exports = {
  entry: "./main.js",
  mode: "development",
  optimization: {
    minimize: false,
  },
  module: {
    rules: [
      // { test: /\.js/, ues: { loader: "babel-loader", options: { presets: ["@babel/preset-env"] } } },
      {
        test: /\.js$/,
        use: {
          loader: "babel-loader",
          options: {
            presets: ["@babel/preset-env"],
            plugins: [
              [
                // 配置 react jsx 语法转换 | 支持库：@babel/plugin-transform-react-jsx
                "@babel/plugin-transform-react-jsx",
                // 自定义 createElement 调用对象名称，默认为 React.createElement
                { pragma: "ToyReact.createElement" }
              ]
            ]
          }
        }
      },
    ]
  }
};